package com.DHH.Service.Base.Impl;
import com.DHH.Entity.Base.BaseRole;
import com.DHH.Mapper.Base.BaseRoleMapper;
import com.DHH.Service.Base.IBaseRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BaseRoleServiceImpl implements IBaseRoleService{
	
	@Autowired
    private BaseRoleMapper baseRoleMapper;
    
   @Override
   public BaseRole insertBaseRole(BaseRole baseRole){
	   
        baseRoleMapper.insertSelective(baseRole);
	   return baseRole;
	   
   };
   @Override
   public BaseRole updateBaseRole(BaseRole baseRole){
	     baseRoleMapper.updateByPrimaryKeySelective(baseRole);
        return baseRole;
   };
   @Override
   public BaseRole deleteBaseRole(BaseRole baseRole){

	     baseRoleMapper.delete(baseRole);
        return baseRole;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public BaseRole saveOrUpdateBaseRole(BaseRole baseRole){
        if(baseRole.getId()==null)
        {
            baseRoleMapper.insertSelective(baseRole);
        }else{
            baseRoleMapper.updateByPrimaryKeySelective(baseRole);
        }
        return baseRole;
    };
}
